//
//  WCBaseRequest.h
//  WonderCommon
//
//  Created by zero on 2020/7/17.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef void(^requestCompletionHandler)(id _Nullable object,
                                        NSHTTPURLResponse * _Nullable response,
                                        NSError *_Nullable error);

@interface WCBaseRequest : NSObject

+ (void)getWithUrl:(NSString *)url
              body:(NSDictionary *_Nullable)params
 completionHandler:(requestCompletionHandler)completionHandler;

+ (void)postWithUrl:(NSString *)url
               body:(NSDictionary *_Nullable)params
  completionHandler:(requestCompletionHandler)completionHandler;

+ (void)requestWithUrl:(NSString *)url
                method:(NSString *)httpMethod
                  body:(NSDictionary *)params
     completionHandler:(requestCompletionHandler)completionHandler;

@end

NS_ASSUME_NONNULL_END
